package com.tencent.txcc;

import com.tencent.txcc.domain.CourseDoc;
import com.tencent.txcc.enums.GlobleExceptionCode;
import com.tencent.txcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ESServiceFallbackFactory implements FallbackFactory<ESService> {
    @Override
    public ESService create(Throwable throwable) {
        return new ESService() {
            @Override
            public JSONResult courseEsAdd(CourseDoc courseDoc) {
                return JSONResult.error(GlobleExceptionCode.ERROR);
            }

            @Override
            public JSONResult courseEsDel(Long id) {
                return JSONResult.error(GlobleExceptionCode.ERROR);
            }
        };
    }
}
